package com.wjerp.tplus.server.common.model;

import com.wjerp.tplus.server.common.utils.RSAUtils;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * 系统用户新增实体
 * @author lishuailei
 */
@Getter
@Setter
public class SystemUserWrapper {

    private String companyCode;
    private String userName;
    private String name;
    private List<Long> permissionIds;
    private String password;

    public String getPassword() {
        if(password != null && !password.isEmpty()){
            try {
                password = new String(RSAUtils.decryptByPrivateKey(password));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return password;
    }

}
